import Vue from 'vue'
import App from './App.vue'
import '@/plugins/element'
import router from '@/router'
import './assets/less/index.less'
import store from '@/store'
import http from 'axios'
import '../api/mock.js'
Vue.prototype.$http = http
Vue.config.productionTip = false


// router.beforeEach((to, from, next) => {
//     store.commit('getToken')
//     const token = store.state.user.token
//     if (!token && to.name !== 'login') {
//         next({ name: 'login' })
//     } else {
//         next()
//     }
// })


new Vue({
    store,
    router,
    render: h => h(App)
}).$mount('#app')